package org.wutopia.labcloud.domain.payment.controller;

import lombok.AllArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.wutopia.labcloud.domain.payment.controller.vo.input.PaymentWalletCreateWalletInputVO;
import org.wutopia.labcloud.domain.payment.controller.vo.input.PaymentWalletDepositInputVO;
import org.wutopia.labcloud.domain.payment.service.PaymentUserWalletService;
import org.wutopia.labcloud.library.common.base.CodedMessage;
import org.wutopia.labcloud.library.common.base.CommonResponse;

@RestController
@AllArgsConstructor
@RequestMapping("/payment")
public class PaymentUserWalletController {

    private PaymentUserWalletService paymentUserWalletService;

    @PostMapping("/user/wallet/create")
    public ResponseEntity<CodedMessage<String>> createWallet(@RequestBody PaymentWalletCreateWalletInputVO vo) {

        paymentUserWalletService.createWallet(vo);

        return CommonResponse.success();
    }

    @PostMapping("/user/wallet/deposit")
    public ResponseEntity<CodedMessage<String>> deposit(@RequestBody PaymentWalletDepositInputVO vo) throws Exception {

        paymentUserWalletService.deposit(vo);

        return CommonResponse.success();
    }


    @PostMapping("/user/wallet/withdrawal")
    public ResponseEntity<CodedMessage<String>> withdrawal() {



        return CommonResponse.success();
    }

    @GetMapping("/hello")
    public String hello() {
        return "你好";
    }
}
